﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ViewModels
{
    /// <summary>
    /// 用户视图模型
    /// </summary>
    public class UserVM
    {
        public Guid UserID { get; set; }
        public string UserName { get; set; }
        public string StuNo { get; set; }
        public string Name { get; set; }
        public bool Gender { get; set; }
        public string GenderString { get; set; }//性别字符串显示
        public string IDNumber { get; set; }
        public DateTime CreateDate { get; set; }
        public string Email { get; set; }
        public string Mobile { get; set; }
        public string Address { get; set; }
        public string URL { get; set; }
        public string UserPassword { get; set; }
        public Guid RoleID { get; set; }
        public string RoleName { get; set; }
        public Guid ClassID { get; set; }//用户班级ID
        public string ClassName { get; set; }//用户班级名称
        public UserVM()
        {
            this.UserID 
                =this.RoleID
                =this.ClassID
                = Guid.NewGuid();
            this.Gender = true;
            if (this.Gender)
                this.GenderString = "男";
            else
                this.GenderString = "女";
        }
        public UserVM(UserVM vm)
        {
            this.UserID = vm.UserID;
            this.UserName = vm.UserName;
            this.StuNo = vm.StuNo;
            this.Name = vm.Name;
            this.Gender = vm.Gender;
            if (this.Gender)
                this.GenderString = "男";
            else
                this.GenderString = "女";
            this.IDNumber = vm.IDNumber;
            this.CreateDate = vm.CreateDate;
            this.Email = vm.Email;
            this.Mobile = vm.Mobile;
            this.Address = vm.Address;
            this.URL = vm.URL;
            this.UserPassword = vm.UserPassword;
            this.RoleID = vm.RoleID;
            this.RoleName = vm.RoleName;
            this.ClassID = vm.ClassID;
            this.ClassName = vm.ClassName;
        }
    }
}
